
import path from 'node:path'

import {defineConfig} from 'vite'   
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [
        vue(),
    ],
    resolve: {
        alias: {
            '@': path.resolve(__dirname, './src')
        }
    },

    server: {
        // 启动后默认打开浏览器
        open: true,
        // 地址
        host: "127.0.0.1",
        // 端口
        port: 4004,
        proxy: {
            '/api': {
                // target:"http://192.168.3.94:3008",
                target:"https://games.hyducc.com",
                changeOrigin: true,
                rewrite(path) {
                    return path.replace(/^\/api/, '')
                }
            }
        }

    }
})
